package day10.StreamTest.FileStream;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Arrays;

public class Test2 {
    public static void main(String[] args) throws IOException {
        FileInputStream in;
        in = new FileInputStream("/Users/hao/Desktop/abc/f3");
        //单字节读取
        int b;
        while((b = in.read()) != -1){
            System.out.println(b);
        }
        in.close();


        in = new FileInputStream("/Users/hao/Desktop/abc/f3");
        //批量读取
        byte[] buff = new byte[5];
        int n;
        while((n = in.read(buff)) != -1){
            System.out.println(n+" - "+ Arrays.toString(buff));
        }

        in.close();
    }
}
